﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MINERP.ComControls
{
    public partial class OrderTitleInfo : UserControl
    {
        public OrderTitleInfo()
        {
            InitializeComponent();
        }

        private void OrderTitleInfo_Load(object sender, EventArgs e)
        {

        }
        public string  Barcode
        {
            get { return txtOrderBarCode.Text.Trim(); }
        }
        #region 绑定订单信息
        /// <summary>
        /// 绑定订单信息
        /// </summary>
        /// <param name="OrderInfo">订单信息</param>
        public void SetDataSource(DataTable OrderInfo)
        {
            if (OrderInfo.Rows.Count > 0)
            {
                DataRow r = OrderInfo.Rows[0];
                txtOrderID.Text = r["OrderID"].ToString();
                txtOrderBarCode.Text = r["OrderBarCode"].ToString();
                txtOrderName.Text = r["OrderName"].ToString();
                txtShopName.Text = r["ShopName"].ToString();
                txtCtmName.Text = r["CtmName"].ToString();
                txtPriority.Text = r["Priority"].ToString();
                txtStatus.Text = r["Status"].ToString();
                txtShopRequire.Text = r["ShopRequire"].ToString();
                txtFetchTime.Text = Convert.ToDateTime(r["FetchTime"]).ToString("yyyy-MM-dd HH:mm");
            }
        }
        #endregion
    }
}
